package com.pj.wisdomlogistics.mvp.presenter;


import com.pj.wisdomlogistics.mvp.contract.ApplyMeetingContract;
import com.pj.wisdomlogistics.mvp.frame.ActivityPresenter;
import com.pj.wisdomlogistics.mvp.model.ApplyMeetingModel;
import com.pj.wisdomlogistics.rx.FilterSubscriber;


public class ApplyMeetingPresenter extends ActivityPresenter<ApplyMeetingModel, ApplyMeetingContract.View> implements ApplyMeetingContract.Presenter {
    public static final String TAG = "ApplyMeetingPresenter";

    @Override
    public void applyMeeting(String userID, String linkman, String officeTel, String linkmanTel,
                             String meetingDate, String startTime, String endTime, String meetingContent,
                             int meetingRoomID, int isSchedule, String peopleCount, String rostrumCount,
                             int mikeCount, String standMike, int music, String banner, String otherService ,
                             String isLift , String openTime , String place) {
        addSubscription(getModel().submitMeetingApply(
                userID, linkman, officeTel, linkmanTel,
                meetingDate, startTime, endTime, meetingContent,
                meetingRoomID, isSchedule, peopleCount, rostrumCount,
                mikeCount, standMike, music, banner, otherService , isLift , openTime , place
        ), new FilterSubscriber<Integer>() {
            @Override
            public void onNext(Integer mInteger) {
                getView().onSuccess(mInteger);
            }

            @Override
            public void onError(int errorCode, String errorMsg) {
                getView().onError(errorMsg);
            }

        });
    }
}
